From: Owen W. Taylor Date: Fri, 28 Aug 2009 16:40:56 +0000 (-0400) Subject: Improve comment about button-release-event handler X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11000 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=943c5e2edc3f56939b62c137ca3a180a781604d1;p=gnome-shell.git Improve comment about button-release-event handler Improve the documentation about the button-release-event handler we put on the status-menu button at Colin's suggestion. http://bugzilla.gnome.org/show_bug.cgi?id=593362 --- diff --git a/js/ui/panel.js b/js/ui/panel.js index 5c9330ef1..4a7505627 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -381,9 +381,14 @@ Panel.prototype = { statusmenu.toggle(e); return false; }); - // This depends on connection ordering: since we are after the Button's - // ::button-release-event handler, calling button.release() will properly - // unset the 'active' flag for this stays-pressed button + // If popping up the menu failed (because there was already a grab in + // effect from Mutter or another app), then we'll never get a ::deactivated + // signal because the menu was never activated, so we need to unhighlight + // separately when the user releases the mouse button. + // + // We depend on connection ordering; this needs to be called after Button's + // ::button-release-event handler; that will set the active flag for this + // stays-pressed button, then we unset the active flag by calling release(). statusbutton.button.connect('button-release-event', function (b, e) { if (!statusmenu.is_active()) statusbutton.release();